# include "iostream"
# include "string"

using namespace std;
// 生成图书馆类
class Library{
    private:
        string bookname;
        string bookauthor;
        int* arr = new int[100];
        
    public:
        Library(){}
        Library(const string &bookname, const string &bookauthor):bookname(bookname), bookauthor(bookauthor){
            cout << "图书馆创建成功！" << endl;
            
        }
        ~Library( ){
            delete[] arr;
            cout << "图书馆销毁成功！" << endl;
        }
        
        void showBook(){
            
            cout << "书名：" << bookname << endl;
            cout << "作者：" << bookauthor << endl;
        }   
};
class Animal{
    public:
        void eat(){
            cout << "动物吃东西" << endl;
        }
};
class Dog: public Animal{
    public:
        void bark(){
            cout << "狗叫" << endl;
        }
};
class Cat: public Animal{
    public:
        void meow(){
            cout << "猫叫" << endl;
        }
};


int main(){
    Library lib("C++ Primer", "Bjarne Stroustrup");
    lib.showBook();
    Library lib2;
    lib2.showBook();

    Dog dog;
    dog.bark();
    dog.eat();

    Cat cat;
    cat.meow();
    cat.eat();

    return 0;
}